﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        const arr = [5, 12, 8, 130, 44];

        //const found = arr.find(element => element > 200);

        //console.log(found);
        let find1 = function (arr,fun) {
            for (var i = 0; i < arr.length; i++) {
                let a = fun(arr[i])
                if (a) {
                    return arr[i];
                }
            }
        }
        let b = find1(arr,(item) => {
            return item > 200;
        }) 
        console.log(b);
    </script>
</body>
</html>